#!/bin/bash

function makedeps() {
    local here=`pwd`
    cd deps
    make lua
    rm -rf hiredis
    git clone https://github.com/redis/hiredis.git
    make hiredis
    cd $here
}

function compile() {
    local here=`pwd`
    local action="make PREFIX=$here install"
    eval $action
}

function install() {
    local here=`pwd`
    local path=`find /usr -name msys-2.0.dll`
    cp $path "$here/bin/msys-2.0.dll"
}

makedeps
compile
install
